import  { Component ,createContext } from 'react';
import ClassParent from './classParent';

interface IProps {
    name: string;
    age: number;
}

const  {Provider,Consumer} = createContext({name:'grandpa',age:0});

class ClassGrandpa extends Component<IProps,IProps> {
  constructor(props) {
      super(props);
      this.state = {
        name: 'ClassGrandpa',
        age:85
      };
  }

  render() {
    return (
      <Provider value={{...this.state}}>
        <ClassParent />
      </Provider>
    );
  }
}

export default ClassGrandpa;